﻿using System;
using System.Collections.Generic;
using NUnit.Framework;

namespace SpellChecker.Tests
{
  [TestFixture]
  class TestExpandDictionary
  {

    [Test]
    public void GoodCase()
    {
      var input = new Dictionary<string, bool>()
      {
        {"a,~b,~c,~de,~1,~~", true},
        {"k,~hh,gh~", true},
      };
      var result = SpellChecker.ExpandDictionary(input);

      var expected = new Dictionary<string, bool>()
      {
        {"a", true},
        {"ab", true},
        {"ac", true},
        {"ade", true},
        {"a1", true},
        {"aa", true},
        {"k", true},
        {"khh", true},
        {"ghk", true},
      };

      Assert.That(result, Is.EqualTo(expected));
    }

    [Test]
    public void TestEmpty()
    {
      var input = new Dictionary<string, bool>()
      {
      };
      var result = SpellChecker.ExpandDictionary(input);

      var expected = new Dictionary<string, bool>()
      {
      };

      Assert.That(result, Is.EqualTo(expected));
    }


  }
}
